package banking;

public class Account {private double balance;
public Account (double bal) {
    balance = bal;
}//初始化
public double getBalance(){
    return balance;
}//获取账户余额
public  boolean deposit (double amount){
    balance= balance +amount;
    return true;
}//存款方法，并记录存款后账户余额
public boolean withdraw (double amount){
    boolean result = true;
    if (balance <amount){
        result = false;
    } else {
        balance =balance - amount;
    }//提款方法，账户余额不足提款失败，账户余额充足可提款，并记录存款后账户余额
    return result;
}

}
